<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>
<?php 
	$match_id = intval($_POST['match_id']);
	$MATCH = $this->match_entity->init('id', $match_id);
	$selectRS = $this->db->where( array('type'=>$MATCH->getFeedType(),'key'=>$MATCH->getFeedKey(),'match_id'=>$MATCH->getFeedMatchId()) )->get(TBL_SCORECARD)->result();
				
?>	

<div class="clrboth"></div>
<div class="grid6">
	<input type="button" value="Add" onclick="add_score_item(<?php echo $match_id;?>);" />
	&nbsp;&nbsp;&nbsp;
</div>
<div class="clrboth"></div>

<table>
	<thead>
		<th>Index</th>
		<th>Result</th>
		<th>Manage</th>
	</thead>
	<tbody>
		<?php foreach($selectRS as $item):?>
		<tr>
			<td><?php echo stringNumberTextFM($item->over_index);?></td>
			<td><?php echo ($item->value);?></td>
			<td>
				<a href="javascript:void(0);" onclick="score_item_edit(<?php echo $item->id;?>,<?php echo $match_id; ?>);">Edit</a> &nbsp;|&nbsp;
				<a href="javascript:void(0);" onclick="score_item_delete(<?php echo $item->id;?>,<?php echo $match_id; ?>);">Delete</a>
				<?php echo loader_image("id=\"loader_image_{$item->id}\" class=\"hidden\"");?>
			</td>
		</tr>	
		<?php endforeach;?>
	</tbody>
</table>